package org.dzq.designmode.flyweight;

/**
 * @ClassName: ConcreteFlyweight
 * @Package: org.dzq.designmode.flyweight
 * @author: 越
 * @date: 2023/6/18 21:24
 * @Description: 具体享元角色
 *
 *
 */
public class ConcreteFlyweight implements IFlyweight{

    private String name;

    public ConcreteFlyweight(String name){
        this.name = name;
    }

    @Override
    public void operation() {
        System.out.println(this);
        System.out.println(this.hashCode());
    }

    @Override
    public String toString() {
        return "ConcreteFlyweight{" +
                "name='" + name + '\'' +
                '}';
    }

    public void setName(String name) {
        this.name = name;
    }
}
